<template>
  <div>
    <van-list>
      <RouterLink
      custom
      v-slot="{navigate}"
      :to="{name:'list',query:{searsh:item.keyworld}}"
      v-for="item in searshList" :key="item.id"
      >
        <van-cell @click="navigate"  :title="item.keyworld" />
      </RouterLink>
    </van-list>
  </div>
</template>
<script setup lang="ts">

import {ref,watchEffect} from 'vue'
import {getSearshListApi} from '@/api/pro'
import  type {IKeywordParmas} from '@/@types/pro'
import _ from 'lodash'
const {searsh}=defineProps<{
  searsh:string
}>()
const searshList=ref<IKeywordParmas[]>([])
const getSearshList=async()=>{
  searshList.value= await getSearshListApi(searsh)
}
// _.debounce(watchEffect(()=>{
//   console.log('111')
//   getSearshList()
// }))
watchEffect(()=>{
  getSearshList()
})
</script>